package app.ep1.test;

import android.test.ActivityInstrumentationTestCase2;
import android.view.KeyEvent;
import android.widget.TextView;
import app.ep1.R;
import app.ep1.seminarios.SeminariosActivity;

public class SeminariosValidation extends
		ActivityInstrumentationTestCase2<SeminariosActivity> {
	public SeminariosValidation() {
		super("app.ep1.seminarios", SeminariosActivity.class);
	}

	@Override
	protected void setUp() throws Exception {
		super.setUp();
	}

	public void testEscolheNomeDoSeminario() {
		SeminariosActivity seminariosActivity = getActivity();

		TextView text = (TextView) seminariosActivity
				.findViewById(R.id.editTextNomeDoSeminario);

		text.requestFocus();
		sendKeys(KeyEvent.KEYCODE_T);
		sendKeys(KeyEvent.KEYCODE_E);
		sendKeys(KeyEvent.KEYCODE_S);
		sendKeys(KeyEvent.KEYCODE_T);
		sendKeys(KeyEvent.KEYCODE_E);

		assertNotNull(text);
		assertEquals("teste", text.getText().toString());
	}
}
